package com.shi.entity;

import com.alibaba.fastjson.JSONObject;

import java.util.Date;

/**
 * collection实体类
 * 
 * @author 
 *
 */
public class Collection {
	/***/
	private String userId; 
	/***/
	private String poemId; 
	/***/
	private Date createTime;
	/***/
	private Date updateTime;
	/***/
	private Integer idDel; 
	/**
	 * 实例化
	 */
	public Collection() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */
	public Collection(JSONObject obj) {
		this();
		if (obj.get("userId") instanceof String) {
			this.setUserId((String) obj.get("userId"));
		}
		if (obj.get("poemId") instanceof String) {
			this.setPoemId((String) obj.get("poemId"));
		}
		if (obj.get("idDel") instanceof Number) {
			this.setIdDel(((Number) obj.get("idDel")).intValue());
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getUserId() != null) {
			result.put("userId",this.getUserId());
		}
		if (this.getPoemId() != null) {
			result.put("poemId",this.getPoemId());
		}
		if (this.getCreateTime() != null) {
			result.put("createTime",this.getCreateTime());
		}
		if (this.getUpdateTime() != null) {
			result.put("updateTime",this.getUpdateTime());
		}
		if (this.getIdDel() != null) {
			result.put("idDel",this.getIdDel());
		}
		return result;
	}
	
	
	/**
	 * 获取userId
	 * 
	 * @return
	 */
	public String getUserId() {
		return userId;
	}

	/**
	 * 设置userId
	 * 
	 * @param userId
	 */
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	/**
	 * 获取poemId
	 * 
	 * @return
	 */
	public String getPoemId() {
		return poemId;
	}

	/**
	 * 设置poemId
	 * 
	 * @param poemId
	 */
	public void setPoemId(String poemId) {
		this.poemId = poemId;
	}
	
	/**
	 * 获取createTime
	 * 
	 * @return
	 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * 设置createTime
	 * 
	 * @param createTime
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	/**
	 * 获取updateTime
	 * 
	 * @return
	 */
	public Date getUpdateTime() {
		return updateTime;
	}

	/**
	 * 设置updateTime
	 * 
	 * @param updateTime
	 */
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	/**
	 * 获取idDel
	 * 
	 * @return
	 */
	public Integer getIdDel() {
		return idDel;
	}

	/**
	 * 设置idDel
	 * 
	 * @param idDel
	 */
	public void setIdDel(Integer idDel) {
		this.idDel = idDel;
	}

	@Override
	public String toString() {
		return "Collection [userId=" + userId + " , poemId=" + poemId + " , createTime=" + createTime + " , updateTime=" + updateTime + " , idDel=" + idDel + "  ]";
	
	}
	
	
}
